<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>department tree</title>
<link rel="stylesheet" type="text/css" href="/static/css/zTreeStyle.css" />
<script type="text/javascript" src="/static/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/static/js/jquery.ztree.core-3.0.js"></script>
<script type="text/javascript">
  <!--
  var setting = {
		  view : {showIcon:false},
		  data: {
		        simpleData: {
		          enable: true
		        }
		      }
		  };

  var zNodes=[
              {% for d in list%}{% if not forloop.first %},{%endif%}{id:{{d.id}},pId:{% if not d.superior_dept%}0{%else%}{{d.superior_dept.id}}{%endif%}, name:"{{d.name}}", url:"/admin/user/list/{{d.id}}", target:"lframe"}{% endfor %}
              ];

  $(document).ready(function(){
    $.fn.zTree.init($("#deptTree"), setting, zNodes);
  });
  //-->
  </script>
</head>
<body>
<div class="content_wrap">
<div class="zTreeDemoBackground left">
<ul id="deptTree" class="ztree"></ul>
</div>
</div>
</body>
</html>